﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BloomsburyBanHang.DTO
{
    public class KhuyenMaiDTO
    {
        private int maKhuyenMai;

        public int MaKhuyenMai
        {
            get { return maKhuyenMai; }
            set { maKhuyenMai = value; }
        }
        private int phanTram;

        public int PhanTram
        {
            get { return phanTram; }
            set { phanTram = value; }
        }


        public static KhuyenMaiDTO Convert(KHUYEN_MAI km)
        {
            KhuyenMaiDTO khuyenmai = new KhuyenMaiDTO();
            khuyenmai.MaKhuyenMai = km.MaKhuyenMai;
            khuyenmai.PhanTram = (int)km.PhanTram;
            return khuyenmai;
        }
        public static List<KhuyenMaiDTO> ListConvert(List<KHUYEN_MAI> lst)
        {
            List<KhuyenMaiDTO> result = new List<KhuyenMaiDTO>();
            for (int i = 0; i < lst.Count; i++)
            {
                result.Add(Convert(lst[i]));
            }
            return result;
        }
    }
}